The present invention relates to a numerical control apparatus (hereinafter referred to as an NC apparatus) in which writing/reading can be commonly performed from a work program as well as a programmable controller.
FIG. 1 is a block diagram showing the arrangement of an NC apparatus. In the drawing, reference numeral 1 designates a tape in which a work program is stored using a special NC language, 2 a reading circuit, 3 a buffer memory, 4 a command decoding circuit, 5 a precalculation circuit, 6 a control circuit, 7 a shaft-displacement amount output circuit, 8 a pulse distribution circuit, 9 a servo unit, 10 a motor, 11 a detector, 12 a spindle rotation detector, 13 a programmable controller (hereinafter referred to as a PC), and 14 a machine tool to be controlled.
The NC apparatus is constituted by the reading circuit 2, the buffer memory 3, the command decoding circuit 4, the precalculation circuit 5, the control circuit 6, and the shaft-displacement amount output circuit 7. Sometimes the apparatus is said to include the pulse distribution circuit 8. As such an NC apparatus, the product MELDAS-L1 produced by Mitsubishi Electric Corporation of Japan, the products FANUC-3T and FANUC-6T produced by Fanuc Co. of Japan, and the products SINUMERIK-3T and SINUMERIK-8T produced by Siemens Co. of West Germany are known.
The operation of such an NC apparatus will be described in brief. The content of the program stored on the tape 1 is read out by the reading circuit 2 and stored in the buffer memory 3. Then, the program is decoded by the command decoding circuit 4 and subjected to preprocessing by the precalculation circuit 5. The resultant data of calculation is transferred to the next stage control circuit 6 to perform on-line control. That is, the amount of shaft displacement of the machine tool 14 is instructed by blocks of data of applied to the shaft-displacement amount output circuit 7 so as to cause the pulse distribution circuit 8 to actuate the servo unit 9 to drive the motor 10 to move the shaft of the machine tool 14. The detector 11 is attached to the motor 10 to detect the amount of rotation of the motor 10. The output of the detector 11 is fed back to the servo unit 9 to drive the motor 10 by a predetermined amount. The spindle rotation detector 12 is attached to spindle for the purpose of detecting the rotary speed of a rotating workpiece or a rotating tool. The output of the spindle is fed back to the pulse distribution circuit 8 and there used to synchronize the rotary speed of the motor 10 with that of the spindle.
The contents of the program on the tape 1 read by the reading circuit 2 include M-commands, S-commands, T-commands, etc. The M-command indicates control commands except a command instructing the displacement of a tool rest of the machine tool to be controlled, a command instructing the selection of cutting tool, and a command instructing the number of revolutions of the spindle. For instance, 100 different commands M00 to M99 are defined by Japanese Industrial Standard No. ISO-R1056. The S-command is used for instructing the speed of the spindle, and is expressed as, for example, S1500 which instructs a spindle speed of 1500 r.p.m. The T-command is a command instructing the selection of one out of a plurality of cutting tools mounted on a tool support. Generally, a plurality of cutting tools are mounted on a polygonal tool support which is rotatable so as to make the instructed cutting tool available. The T-command is expressed as, for example, T01 which instructs to select No. 1 cutting tool.
The PC 13 is a sequence used for performing control, such as oil pressure control, control relating to auxiliary function such as tool replacement, spindle drive, etc., that is, control functions except the control of shaft drive of the machine tool 14, and is arranged to exchange signals with the control circuit 6 to perform the above-mentioned control. That is, the PC 13 decodes M-, S-, T-commands provided by the control circuit 6 and produces signals which are applied as control signals to operating units for the machine tool in accordance with a predetermined sequence. In response to the control signals, mechanical operations of the machine tool are performed and the control circuit 6 is informed of the completion of execution of commands upon the detection of the mechanical operations.
Details of the operations of the PC 13 will be described. The description is made here with respect to the case where "COOLANT OIL ON" (M08) and "COOLANT OIL OFF" (M09) are given as control signals from the control circuit 6. FIG. 2 is a diagram showing a relay circuit for causing the operation of the above-mentioned commands to be performed. This circuit is realized by a program in the PC 13. In FIG. 2 reference numeral 20 designates a decoder circuit for the commands M08 and M09 from the control circuit 6, and 21 is a circuit for confirming the fact that the machine has been operated by the commands M08 and M09. M8*, M4*, M2* and M1* designate contacts respectively corresponding to the commands M80, M40, M20, and M10 issued from the NC apparatus and M*8, M*4, M*2, and M*1 designate contacts respectively corresponding to the commands M8, M4, M2, and M1 issued from the NC apparatus. The PC 13 decodes the commands M08 and M09 and provides its output to the machine side as shown in FIG. 3 to thereby perform "COOLANT OIL ON" and "COOLANT OIL OFF" operations.
In the conventional NC apparatus, however, the M-command, S-command, T-command, and the like are applied to the PC 13 unidirectionally from the work program of the tape 1.
Further, recently it has been understood that (1) it is desirable to refer to the data in the PC 13 from the work program side, and (2) it is desirable to issue more commands to the PC 13 from the work program side. However, there has been no NC apparatus provided with effective means for satisfying these requirements.
That is, there are new requirements for robot combination, automatic work measurement, tool life management etc. An NC apparatus which can meet such requirements is needed. To provide such an apparatus, it is necessary to expand the interface function with external devices such as machines measuring units, etc.
Although the command instructing the displacing of the tool support of the machine tool is transmitted to the pulse distribution circuit and the servo unit through the shaft-displacement amount output circuit 7, the PC 13 is used as an interface with the machine side for all other commands, and therefore it is convenient to achieve through the PC the above-mentioned expansion of the interface function.
Accordingly, the above-mentioned data at the PC 13 side is applied to external devices such as machines, measuring devices, etc., and in the case where an automatized system is employed in which, for example, a workpiece on which work has been completed is transported from the machine tool to an automatic measuring device using a handling robot and the NC apparatus receives the result of measurement to feed it back as a correction data for the next workpiece, the following are required:
(1) output of an operating command (displacement amount if necessary) to the handling robot; PA1 (2) output of a measurement start command to the measuring device; and PA1 (3) input of data of measurement result, etc.
Thus, there is a requirement for the data at the PC 13 side to be accessible from the work program side so as to increase the number of commands issued from the work program side to the PC 13.